/*
 * sensorvalue_generation.h
 *
 *  Created on: 23 apr. 2013
 *      Author: Pascal
 */

#ifndef SENSORVALUE_GENERATION_H_
#define SENSORVALUE_GENERATION_H_

#include <stdlib.h>
#include "sensors.h"

#define ANALOG_MAX_DEVIATION 3.0005
#define ANALOG_CENTRE_VALUE 50.00
/**
 * The higher this number, the lower the change an analog sensor will get an alarm value.
 */
#define SENSORVALUE_GENERATION_OFFSET_DIVIDER 50000
/**
 * The chance a true value will come out of the generation.
 * (1 in BINARY_SENSOR_CHANCE_FOR_TRUE, so higher value is lower chance.
 */
#define BINARY_SENSOR_CHANCE_FOR_TRUE 50000

double randBetween(double lower, double upper);
double generateAnalogValue(struct AnalogSensor*);
int generateBinaryValue();
void getRandomUnit(struct AnalogSensor*);

#endif /* SENSORVALUE_GENERATION_H_ */
